#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2024/9/6 11:11
# @File           : vendor
# @IDE            : PyCharm
# @desc           : 描述

from sqlalchemy.orm import Mapped, mapped_column
from db.db_base import BaseModel, AuditModel
from sqlalchemy import String, Boolean, Text, UniqueConstraint


class DCParam(AuditModel):
    __tablename__ = "dc_check_param"
    __table_args__ = (
        UniqueConstraint('param_type', 'param_name', 'param_value', name="Idx_Param_Type_Value"),
        {'comment': 'QAR管理参数'}
    )

    param_type: Mapped[str] = mapped_column(String(20), comment="参数类型")
    param_name: Mapped[str] = mapped_column(String(40), comment="参数名称")
    param_value: Mapped[str] = mapped_column(String(20), comment="参数值")

    param_detail: Mapped[str] = mapped_column(String(60), nullable=True, comment="参数明细")
    attachment: Mapped[str] = mapped_column(Text, nullable=True, comment="附件")
    remark: Mapped[str] = mapped_column(String(50), nullable=True, comment="备注")

    is_active: Mapped[bool] = mapped_column(Boolean, default=True, comment="是否启用")
